﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Pixysoft.Security
{
    /// <summary>
    /// %e5%a4%a7%e5%9f%8e%e5%b0%8f%e6%a0%bc
    /// </summary>
    public class UrlCoder
    {
        public static string UrlEncode(string str)
        {
            return System.Web.HttpUtility.UrlEncode(str);
        }

        public static string UrlEncode(byte[] str)
        {
            return System.Web.HttpUtility.UrlEncode(str);
        }


        public static string UrlDecode(string str)
        {
            return System.Web.HttpUtility.UrlDecode(str);
        }

        public static string UrlDecode(string str, Encoding encoding)
        {
            return System.Web.HttpUtility.UrlDecode(str, encoding);
        }

        public static byte[] UrlDecodeToBytes(string str)
        {
            return System.Web.HttpUtility.UrlDecodeToBytes(str);
        }

        public static byte[] UrlDecodeToBytes(string str, Encoding encoding)
        {
            return System.Web.HttpUtility.UrlDecodeToBytes(str, encoding);
        }

        private void test()
        {

            Console.WriteLine(UrlEncode("<h>sdf</h>"));
        }
    }
}
